package com.littcore.saap.common.session;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.filter.OncePerRequestFilter;

public class SessionFilter extends OncePerRequestFilter implements Filter{
    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {

        SessionRequestWrap requestWrap=new SessionRequestWrap(request);
        SessionResponseWrap responseWrap=new SessionResponseWrap(requestWrap,response);
       
        try{
            filterChain.doFilter(requestWrap,responseWrap);
        } finally{
          //  responseWrap.commitSession();
        }
        
    }

}
